import { createRouter, createWebHashHistory } from "vue-router"


let routes = [
    {
        path: "/",
        component: () => import("../pages/home/index.vue"),
        meta:{
            name:'导航首页',
            path:"/"
        },
        name:"/",
        children: [
            {
                redirect: "/discover/paylist",
                path: "discover",
                component: () => import("../pages/discover/index.vue"),
                name:"discover",
                meta:{
                    name:'发现首页'
                },
                children: [
                    {
                        path: "paylist",
                        component: () => import("../pages/discover/paylist/index.vue"),
                        name:"paylist",
                        meta:{
                            name:"歌单"
                        }
                    }
                ]
            },
            {
                path: "mine",
                name:"mine",
                meta:{
                    name:"个人中心",
                },
                component: () => import("../pages/mine/index.vue")
            },
            {
                props: true,
                path: "friend/:id",
                name:"friend",
                meta:{
                    name:"我的朋友"
                },
                component: () => import("../pages/friend/index.vue")
            }
        ]
    },
    {
        path: "/login",
        name:"login",
        meta:{
            name:"登入页面"
        },
        component: () => import("../pages/login/index.vue")
    },
]

const router = createRouter({
    history: createWebHashHistory("/base"),
    routes
})

export default router